<?php

/**
 * Menashop
 *
 * LICENSE
 *
 * This source file is subject to the license that is bundled
 * with this project in the file LICENSE.txt
 *
 * @category   Zend
 * @package    Storefront_Model
 * @subpackage FormSearch
 * @copyright  Copyright (c) 2011 Menashop UA Inc. (http://www.menashop.com.ua)
 * @license    LICENSE.txt
 * @version    1.0.0
 * @since      File available since Release 1.0.0
 */

/**
 * The form for login
 * 
 * @category   Zend
 * @package    Storefront_Model
 * @subpackage FromSearch
 * @copyright  Copyright (c) 2011 Menashop UA Inc. (http://www.menashop.com.ua)
 * @license    LICENSE.txt
 */
class Storefront_Model_FormSearch extends Zend_Form
{

    public function init()
    {
        $this->setMethod('get');

        $phrase = new Zend_Form_Element_Text('phrase');
        $phrase->setRequired(true);
        $phrase->addValidator('StringLength', false, array(2, 50));
        $phrase->addErrorMessage('Please, input minimum 2 symbols for search');
        $phrase->removeDecorator('label');
        $phrase->removeDecorator('htmlTag');
        $phrase->removeDecorator('Errors');
        $phrase->setAttrib('class', 'search-input');

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Search');
        $submit->removeDecorator('DtDdWrapper');
        $submit->setAttrib('class', 'search-button');

        $this->setDecorators(array(array('ViewScript', array('viewScript' => '_form_search.phtml'))));
        $this->addElements(array($phrase, $submit));
    }

}

